<form class="form-horizontal" name="form1" ng-submit="onSubmit(form1)">
  <div class="modal-header">
    <button type="button" class="close" ng-click="cancel()">
      <span aria-hidden="true">&times;</span>
    </button>
    <h4 class="modal-title">
      <i class="fa fa-cog text-warning"></i> {{'settings'|translate}}
    </h4>
  </div>

  <div class="modal-body" style="max-height: 500px; overflow-y: auto;">
    <fieldset>
      <legend>
        <h5 class="text-primary">{{'settings.WhetherResumeUpload'|translate}}</h5>
      </legend>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          <!-- 是否启用断点续上传: true -->
          {{'settings.WhetherResumeUpload'|translate}}:
        </label>
        <div class="col-sm-7">
          <div class="checkbox">
            <label>
              <input type="checkbox" name="resumeUpload" ng-model="set.resumeUpload" ng-change="setChange(form1,'resumeUpload')"
                ng-true-value="1" ng-false-value="0" />
              ({{'settings.WhetherResumeUpload.msg'|translate}})
            </label>
          </div>
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          {{'settings.ResumeUploadThreshold'|translate}}:
        </label>
        <div class="col-sm-7">
          <input type="number" name="multipartUploadThreshold" ng-model="set.multipartUploadThreshold" ng-change="setChange(form1,'multipartUploadThreshold')" max="1000" min="10" required class=" form-control" />
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          {{'settings.ResumeUploadSize'|translate}}:
        </label>
        <div class="col-sm-7">
          <input type="number" name="multipartUploadSize" ng-model="set.multipartUploadSize" ng-change="setChange(form1,'multipartUploadSize')" is-multiple-of-four max="100" min="8" step="4" required class=" form-control" />
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          <!-- 最大上传任务数: -->
          {{'settings.maxUploadConcurrency'|translate}}:
        </label>
        <div class="col-sm-7">
          <input type="number" name="maxUploadConcurrency" ng-model="set.maxUploadConcurrency" ng-change="setChange(form1,'maxUploadConcurrency')" max="10" min="1" required class=" form-control" />
        </div>
      </div>
    </fieldset>

    <fieldset>
      <legend>
        <h5 class="text-primary">{{'settings.WhetherUploadSpeedLimitEnabled'|translate}}</h5>
      </legend>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          <!-- 是否启用上传限速: true -->
          {{'settings.WhetherUploadSpeedLimitEnabled'|translate}}:
        </label>
        <div class="col-sm-7">
          <div class="checkbox">
            <label>
              <input type="checkbox" name="uploadSpeedLimitEnabled" ng-model="set.uploadSpeedLimitEnabled" ng-change="setChange(form1,'uploadSpeedLimitEnabled')"
                ng-true-value="1" ng-false-value="0" />
              ({{'settings.WhetherUploadSpeedLimitEnabled.msg'|translate}})
            </label>
          </div>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-4 control-label">
          {{'settings.UploadSpeedLimit'|translate}}:
        </label>
        <div class="col-sm-7">
          <input type="number" name="uploadSpeedLimitKBperSec" ng-model="set.uploadSpeedLimitKBperSec" ng-change="setChange(form1,'uploadSpeedLimitKBperSec')" max="102400" min="1" ng-disabled="!set.uploadSpeedLimitEnabled" class="form-control" />
        </div>
      </div>
    </fieldset>

    <fieldset>
      <legend>
        <h5 class="text-primary">{{'settings.WhetherResumeDownload'|translate}}</h5>
      </legend>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          <!-- 是否启用断点续下载: true -->
          {{'settings.WhetherResumeDownload'|translate}}:
        </label>
        <div class="col-sm-7">
          <div class="checkbox">
            <label>
              <input type="checkbox" name="resumeDownload" ng-model="set.resumeDownload" ng-change="setChange(form1,'resumeDownload')"
                ng-true-value="1" ng-false-value="0" />
              ({{'settings.WhetherResumeDownload.msg'|translate}})
            </label>
          </div>
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          {{'settings.ResumeDownloadThreshold'|translate}}:
        </label>
        <div class="col-sm-7">
          <input type="number" name="multipartDownloadThreshold" ng-model="set.multipartDownloadThreshold" ng-change="setChange(form1,'multipartDownloadThreshold')" max="1000" min="10" required class=" form-control" />
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          {{'settings.ResumeDownloadSize'|translate}}:
        </label>
        <div class="col-sm-7">
          <input type="number" name="multipartDownloadSize" ng-model="set.multipartDownloadSize" ng-change="setChange(form1,'multipartDownloadSize')" max="100" min="8" required class=" form-control" />
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          <!-- 最大下载任务数: -->
          {{'settings.maxDownloadConcurrency'|translate}}:
        </label>
        <div class="col-sm-7">
          <input type="number" name="maxDownloadConcurrency" ng-model="set.maxDownloadConcurrency" ng-change="setChange(form1,'maxDownloadConcurrency')" max="10" min="1" required class=" form-control" />
        </div>
      </div>
    </fieldset>

    <fieldset>
      <legend>
        <h5 class="text-primary">{{'settings.WhetherDownloadSpeedLimitEnabled'|translate}}</h5>
      </legend>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          <!-- 是否启用上传限速: true -->
          {{'settings.WhetherDownloadSpeedLimitEnabled'|translate}}:
        </label>
        <div class="col-sm-7">
          <div class="checkbox">
            <label>
              <input type="checkbox" name="downloadSpeedLimitEnabled" ng-model="set.downloadSpeedLimitEnabled" ng-change="setChange(form1,'downloadSpeedLimitEnabled')"
                ng-true-value="1" ng-false-value="0" />
              ({{'settings.WhetherDownloadSpeedLimitEnabled.msg'|translate}})
            </label>
          </div>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-4 control-label">
          {{'settings.DownloadSpeedLimit'|translate}}:
        </label>
        <div class="col-sm-7">
          <input type="number" name="downloadSpeedLimitKBperSec" ng-model="set.downloadSpeedLimitKBperSec" ng-change="setChange(form1,'downloadSpeedLimitKBperSec')" max="102400" min="1" ng-disabled="!set.downloadSpeedLimitEnabled" class="form-control" />
        </div>
      </div>
    </fieldset>

    <fieldset>
      <legend>
        <h5 class="text-primary">{{'settings.ExternalPath'|translate}}</h5>
      </legend>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          <!-- 启用外部路径: -->
          {{'settings.ExternalPath'|translate}}:
        </label>
        <div class="col-sm-7">
          <div class="checkbox">
            <label>
              <input type="checkbox" name="externalPathEnabled" ng-model="set.externalPathEnabled" ng-change="setChange(form1,'externalPathEnabled')" ng-true-value="1"
                ng-false-value="0" />
              ({{'settings.WhetherExternalPathEnabled.msg'|translate}})
            </label>
          </div>
        </div>
      </div>
    </fieldset>

    <fieldset>
      <legend>
        <h5 class="text-primary">{{'settings.system'|translate}}</h5>
      </legend>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          <!-- 调试日志: -->
          {{'settings.isDebug'|translate}}:
        </label>
        <div class="col-sm-7">
          <div class="checkbox">
            <label>
              <input type="checkbox" name="isDebug" ng-model="set.isDebug" ng-change="setChange(form1,'isDebug')" ng-true-value="1"
                ng-false-value="0" />
              ({{'settings.isDebug.msg'|translate}})
            </label>
          </div>
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          <!-- 启用外部 node: -->
          {{'settings.useElectronNode'|translate}}:
        </label>
        <div class="col-sm-7">
          <div class="checkbox">
            <label>
              <input type="checkbox" name="useElectronNode" ng-model="set.useElectronNode" ng-change="setChange(form1,'useElectronNode')" ng-true-value="1"
                ng-false-value="0" />
              ({{'settings.useElectronNode.msg'|translate}})
            </label>
          </div>
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-4 control-label">
          <!-- 自动更新: -->
          {{'settings.autoUpgrade'|translate}}:
        </label>
        <div class="col-sm-7">
          <div class="checkbox">
            <label>
              <input type="checkbox" name="autoUpgrade" ng-model="set.autoUpgrade" ng-change="setChange(form1,'autoUpgrade')" ng-true-value="1"
                ng-false-value="0" />
              ({{'settings.autoUpgrade.msg'|translate}})
            </label>
          </div>
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-4 control-label">{{'language'|translate}}:</label>
        <div class="col-sm-7">
          <select class="form-control input-sm" ng-model="langSettings.lang" ng-change="langSettings.changeLanguage(langSettings.lang)" ng-options="a.lang as a.label for a in langSettings.langList"></select>
        </div>
      </div>
    </fieldset>

  </div>

  <div class="modal-footer">
    <!-- <button type="submit" class="btn btn-success btn-sm">
      <i class="glyphicon glyphicon-ok"></i> {{'save'|translate}}
    </button> -->
    <button type="button" class="btn btn-default btn-sm" ng-click="cancel()">
      <i class="glyphicon glyphicon-remove"></i>
      <!-- 关闭 -->
      {{'close'|translate}}
    </button>
  </div>

</form>
